<html>
<head><meta charset="utf-8"><title>miri · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html">miri</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="163488051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163488051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163488051">(Apr 16 2019 at 17:16)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span>  Is <a href="https://gist.github.com/lnicola/b037765b02d0d573d73c4302d14ea03e" target="_blank" title="https://gist.github.com/lnicola/b037765b02d0d573d73c4302d14ea03e">this</a> a limitation of <code>miri</code>, or a bug in the program? Sorry for subscribing you, I'm not sure how else to ping you.</p>



<a name="163489373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163489373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163489373">(Apr 16 2019 at 17:31)</a>:</h4>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> subscribing is fine. ;) alternatively try the "general" stream; the question does not seem particularily RLS-related</p>



<a name="163489423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163489423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163489423">(Apr 16 2019 at 17:31)</a>:</h4>
<p>to answer your question, the error means that Miri thinks this code has UB for using pointers the wrong way</p>



<a name="163489485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163489485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163489485">(Apr 16 2019 at 17:32)</a>:</h4>
<p>those checks and the models they use are experimental, so this does not mean your program is wrong. but it is an interesting result, when Miri disallows something people expect to work we should figure out what it is.</p>



<a name="163489549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163489549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163489549">(Apr 16 2019 at 17:33)</a>:</h4>
<p>it is hard to say more than that without a way for me to reproduce the problem. the code seems to do crazy stuff with transmutes/unions, so I wouldnt be surprised if there was something wrong in it^^</p>



<a name="163489670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163489670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163489670">(Apr 16 2019 at 17:34)</a>:</h4>
<p>it is related to rls :D</p>



<a name="163489690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163489690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163489690">(Apr 16 2019 at 17:35)</a>:</h4>
<p>okay^^ I dont see the connection then ;)</p>



<a name="163489693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163489693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163489693">(Apr 16 2019 at 17:35)</a>:</h4>
<p>or rust-analyzer</p>



<a name="163489775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163489775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163489775">(Apr 16 2019 at 17:36)</a>:</h4>
<p>I tried to run some of its tests under miri</p>



<a name="163490051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163490051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163490051">(Apr 16 2019 at 17:39)</a>:</h4>
<p>if you could minimize this to an as-small-as-possible testcase that still fails, that'd be awesome</p>



<a name="163490328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163490328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163490328">(Apr 16 2019 at 17:42)</a>:</h4>
<p>but even if not, please report an issue at <a href="https://github.com/rust-lang/miri/" target="_blank" title="https://github.com/rust-lang/miri/">https://github.com/rust-lang/miri/</a> with instructions for how to reproduce the problem</p>



<a name="163490384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163490384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163490384">(Apr 16 2019 at 17:43)</a>:</h4>
<p>that code is way over my head</p>



<a name="163490426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163490426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163490426">(Apr 16 2019 at 17:44)</a>:</h4>
<p>I don't think it's a miri bug</p>



<a name="163490507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163490507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163490507">(Apr 16 2019 at 17:44)</a>:</h4>
<p>I'm sure <span class="user-mention" data-user-id="133169">@matklad</span> will be happy to see this</p>



<a name="163490848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163490848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163490848">(Apr 16 2019 at 17:49)</a>:</h4>
<p>oh yeah, I am doing completely crazy stuff in rowan, and I am totally not sure if it works.</p>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> how did you get miri to work with rowan? Last time I've checked, it failed because of random numbers somewhere...</p>



<a name="163490879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163490879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163490879">(Apr 16 2019 at 17:49)</a>:</h4>
<p>I have this nightly</p>



<a name="163490883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163490883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163490883">(Apr 16 2019 at 17:49)</a>:</h4>
<p><code>rustc 1.35.0-nightly (aa99abeb2 2019-04-14)</code></p>



<a name="163490956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163490956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163490956">(Apr 16 2019 at 17:50)</a>:</h4>
<p>And what command are you running?</p>



<a name="163490971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163490971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163490971">(Apr 16 2019 at 17:50)</a>:</h4>
<p>I installed miri with rustup, then ran <code>~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri miri test</code> in the <code>ra_syntax</code> crate</p>



<a name="163490983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163490983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163490983">(Apr 16 2019 at 17:50)</a>:</h4>
<p><code>ra_assists</code> also reports an uninitialized read somewhere</p>



<a name="163491013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163491013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163491013">(Apr 16 2019 at 17:51)</a>:</h4>
<p><code>ra_arena</code> seems clean</p>



<a name="163491148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163491148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163491148">(Apr 16 2019 at 17:53)</a>:</h4>
<p><code>rowan</code>'s tests also pass</p>



<a name="163491170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163491170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163491170">(Apr 16 2019 at 17:53)</a>:</h4>
<p>that's because rowan basically has no tests, everything is tested in rust-analyzer :D</p>



<a name="163491187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163491187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163491187">(Apr 16 2019 at 17:53)</a>:</h4>
<p>ah, I didn't check :D</p>



<a name="163491656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163491656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163491656">(Apr 16 2019 at 17:59)</a>:</h4>
<p>Miri supports random numbers since very recently</p>



<a name="163491665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163491665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163491665">(Apr 16 2019 at 17:59)</a>:</h4>
<p>you need to pass <code>-Zmiri-seed=&lt;some hex&gt;</code></p>



<a name="163491698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163491698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163491698">(Apr 16 2019 at 18:00)</a>:</h4>
<p>but <span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> didnt seem to do that so maybe that test doesnt even need entropy?</p>



<a name="163492010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492010">(Apr 16 2019 at 18:02)</a>:</h4>
<p>I don't see any <code>rand</code> dependency</p>



<a name="163492068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492068">(Apr 16 2019 at 18:03)</a>:</h4>
<p>does it actually support the rand crate? how does that work?</p>



<a name="163492184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492184">(Apr 16 2019 at 18:04)</a>:</h4>
<p>that was a while ago, maybe I am remembering the things incorrectly.</p>
<p>Looking at the error, it looks like it's in the <code>colleseum</code> crate, which is <code>typed-arena</code>, but with a mutex on top</p>



<a name="163492196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492196">(Apr 16 2019 at 18:04)</a>:</h4>
<p>a-ha, reproduced the error locally</p>



<a name="163492220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492220">(Apr 16 2019 at 18:05)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> you remember correctly, entropy support in Miri was added less than a week ago^^</p>



<a name="163492280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492280">(Apr 16 2019 at 18:05)</a>:</h4>
<blockquote>
<p>does it actually support the rand crate? how does that work?</p>
</blockquote>
<p>you pass Miri a seed and it uses that to generate "entropy" whenever the program asks for it</p>



<a name="163492431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492431">(Apr 16 2019 at 18:07)</a>:</h4>
<p>but there are a lot of ways to request entropy, how does it hook all of them?</p>



<a name="163492447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492447">(Apr 16 2019 at 18:07)</a>:</h4>
<p>what does <code>mem::transmute::&lt;&amp;mut T, &amp;mut T&gt;</code> do?</p>



<a name="163492550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492550">(Apr 16 2019 at 18:08)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> made a relatively easy repro. This is not rust-analyzer related, the famous typed-arena crate is affected</p>
<div class="codehilite"><pre><span></span>λ git clone git@github.com:SimonSapin/rust-typed-arena.git

21:06:50|~/tmp
λ cd rust-typed-arena/

21:06:53|~/tmp/rust-typed-arena|master✓
λ ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri miri test # cargo miri doesn&#39;t work for me for whatever reason
...
 constant evaluation error: stopping looking for borrow being accessed (Alias(None)) because of barrier (38549)
</pre></div>



<a name="163492564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492564">(Apr 16 2019 at 18:08)</a>:</h4>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> it thransmutes lifetimes</p>



<a name="163492578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492578">(Apr 16 2019 at 18:09)</a>:</h4>
<p>oooh</p>



<a name="163492635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492635">(Apr 16 2019 at 18:09)</a>:</h4>
<p>I guess, I'll open a bug in typed arena and CC you. The code looks reasonable to me</p>



<a name="163492809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492809">(Apr 16 2019 at 18:11)</a>:</h4>
<p>yeah, I should have checked all of the deps first (:</p>



<a name="163492891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492891">(Apr 16 2019 at 18:12)</a>:</h4>
<p>typed_arena is not a dependency, collesseum is. but collesseum is a fancier typed_arena, and the same bug triggers for later</p>



<a name="163492944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163492944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163492944">(Apr 16 2019 at 18:13)</a>:</h4>
<p>it triggers in both of them, yup</p>



<a name="163493057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163493057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163493057">(Apr 16 2019 at 18:14)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> filed <a href="https://github.com/SimonSapin/rust-typed-arena/issues/26" target="_blank" title="https://github.com/SimonSapin/rust-typed-arena/issues/26">https://github.com/SimonSapin/rust-typed-arena/issues/26</a></p>



<a name="163493227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163493227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163493227">(Apr 16 2019 at 18:16)</a>:</h4>
<p>there's also one in ra_assists</p>



<a name="163493289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163493289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163493289">(Apr 16 2019 at 18:17)</a>:</h4>
<blockquote>
<p>but there are a lot of ways to request entropy, how does it hook all of them?</p>
</blockquote>
<p>it just hooks whatever <code>rand</code> uses on Windows and Linux. That's good enough for now ;)</p>



<a name="163493325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163493325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163493325">(Apr 16 2019 at 18:18)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> filed <a href="https://github.com/SimonSapin/rust-typed-arena/issues/26" target="_blank" title="https://github.com/SimonSapin/rust-typed-arena/issues/26">https://github.com/SimonSapin/rust-typed-arena/issues/26</a></p>
</blockquote>
<p>thanks! I'll have a look once I find some time.</p>



<a name="163493793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163493793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163493793">(Apr 16 2019 at 18:23)</a>:</h4>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> <span class="user-mention" data-user-id="120791">@RalfJ</span> the second error you are observing is <a href="https://github.com/servo/rust-smallvec/issues/126" target="_blank" title="https://github.com/servo/rust-smallvec/issues/126">https://github.com/servo/rust-smallvec/issues/126</a></p>



<a name="163495256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163495256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163495256">(Apr 16 2019 at 18:40)</a>:</h4>
<p>I suppose there's no way to tell miri to continue after it finds an error?</p>



<a name="163534862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163534862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163534862">(Apr 17 2019 at 06:21)</a>:</h4>
<p>No, Miri is not able to distinguish between fatal errors and those that it could in principle ignore.</p>



<a name="163651287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163651287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163651287">(Apr 18 2019 at 13:29)</a>:</h4>
<p>Turns out this is a somewhat deep problem that would have to be fixed in <code>Vec::push</code>: <a href="https://github.com/SimonSapin/rust-typed-arena/issues/26#issuecomment-484507322" target="_blank" title="https://github.com/SimonSapin/rust-typed-arena/issues/26#issuecomment-484507322">https://github.com/SimonSapin/rust-typed-arena/issues/26#issuecomment-484507322</a></p>



<a name="163653299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163653299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163653299">(Apr 18 2019 at 13:55)</a>:</h4>
<p>Cool! So that means that C++ style guarantee of "no refernces/iteraros are invalidated in push if there's enough capcity" has a real, checkable code underneath it! I am absolutely amazed by how powerful miri's approach of "let's check for UB by definition" is in practice.</p>



<a name="163655406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163655406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163655406">(Apr 18 2019 at 14:17)</a>:</h4>
<p>:)</p>



<a name="163655565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/miri/near/163655565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/miri.html#163655565">(Apr 18 2019 at 14:19)</a>:</h4>
<p>there's "just" the caveat that you need some code that actually exhibits the problematic behavior -- basically we need people to write test cases for all sorts of things that they think should be legal unsafe interactions with types like <code>Vec</code>, and have them all be checked by Miri.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>